var attribute = {
    codehelp: {
        title: "使用帮助",
        path: "minicard/doc/code-help"
    },
    agreement: {
        title: "服务协议",
        path: "minicard/agreement/agreement"
    },
    legislation: {
        title: "法律声明",
        path: "minicard/agreement/legislation"
    },
    siteAgreement: {
        title: "服务协议",
        path: "site/agreement/agreement"
    },
    siteLegislation: {
        title: "法律声明",
        path: "site/agreement/legislation"
    },
    help: {
        title: "使用小技巧",
        path: "minicard/teach/index"
    },
    radarGuide: {
        title: "设置引导",
        path: "https://api.ibos.cn/minicard/wechat/radarguide"
    },
    official: {
        title: "关注公众号",
        path: "https://api.ibos.cn/minicard/wechat/guide"
    },
    wechat: {
        title: "加微信",
        path: "https://api.ibos.cn/minicard/wechat/guide"
    }
}, agreementUrl = function(t, e, a, i, n) {
    var c = getApp().globalData, o = c.systemInfo, s = c.BAR_HEIGHT, r = o.version.replace(/\./g, "") < 672, l = "";
    return l = /^https/.test(attribute[t].path) ? attribute[t].path : "https://oss.ibos.cn/common/".concat(attribute[t].path, ".html"), 
    n = n.replace("img.ibos", "oss.ibos").replace("http:", "https:"), "".concat(l).concat(l.includes("?") ? "&" : "?", "type=").concat(t, "&barHeight=").concat(s, "&showNav=").concat(+r, "&save=").concat(e || "", "&t=").concat(Date.now(), "&value=").concat(n, "&name=").concat(a, "&desc=").concat(i);
};

Page({
    onLoad: function(t) {
        var e = t.type, a = t.save, i = t.name, n = t.desc, c = t.value;
        this.setData({
            url: agreementUrl(e, a, decodeURIComponent(i || ""), decodeURIComponent(n || ""), decodeURIComponent(c || ""))
        }), wx.setNavigationBarTitle({
            title: attribute[e].title
        });
    },
    onMessage: function(t) {
        console.log(t);
    }
});